﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace 控件
{
    

    /// <summary>
    /// LeftMenu.xaml 的交互逻辑
    /// </summary>
    public partial class LeftMenu : Window
    {

        private bool isMenuOpen = false;

        public LeftMenu()
        {
            InitializeComponent();

            // 为菜单添加变换
            SideMenu.RenderTransform = new TranslateTransform();
        }

        private void ToggleMenu_Click(object sender, RoutedEventArgs e)
        {
            if (isMenuOpen)
            {
                // 隐藏菜单
                Storyboard hideMenu = (Storyboard)FindResource("HideMenu");
                hideMenu.Begin();
            }
            else
            {
                // 显示菜单
                Storyboard showMenu = (Storyboard)FindResource("ShowMenu");
                showMenu.Begin();
            }

            isMenuOpen = !isMenuOpen;
        }
    }
}
